package com.cccyy.date;

import cn.hutool.core.date.DateUtil;

import java.util.Date;

public class StrDate {
    public static void main(String[] args) {
        String dateStr = "20240112";
        StringBuilder stringBuilder = new StringBuilder(dateStr);
        stringBuilder.insert(6, "-");
        stringBuilder.insert(4, "-");
        String string = stringBuilder.toString();
        System.out.println("日期类型转换？：" + string);
        String today = DateUtil.today();
        System.out.println(today);
        String format = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss.sss");
        System.out.println(format);
    }

}
